package com.atguigu.yygh.sta.controller;

import com.atguigu.common.result.Result;
import com.atguigu.yygh.order.client.OrderFeignClient;
import com.atguigu.yygh.vo.order.OrderCountQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin/sta")
public class StaController {

    @Autowired
    OrderFeignClient orderFeignClient;

    @PostMapping("getCountMap")
    public Result getCountMap(@RequestBody OrderCountQueryVo orderCountQueryVo){
        Map map = orderFeignClient.getCountMap(orderCountQueryVo);//dateList + countList （调用订单服务返回map）
        return Result.ok().data(map);
    }

}
